#include <windows.h>
#include <dask.h>
extern "C"
{
	#include "lua.h"
	#include "lauxlib.h"
	#include "lualib.h"
}

#define MAX_N_CARDS 4
#define CHAN_PER_CARD 16
#define ErrorSequenceNumberOutOfRange -301
#define ErrorChannelNumberOutOfRange -302

#define MAX_V  10.0
#define MIN_V -10.0

class DevMgr
{
public:
	DevMgr();
	I16 open_dev(U16 dev_num,U16 seq_num);
	I16 output(U16 chan,F64 value);
	I16 close_dev(U16 card_num);
private:
	I16 card_id[MAX_N_CARDS];
	DevMgr(const DevMgr&);
};

extern DevMgr * dev_mgr_ptr;

int luaopen_DA6208(lua_State * L);
static int OpenDev(lua_State * L);
static int CloseDev(lua_State * L);
static int Output(lua_State * L);